package com.sjb.sixteen_journey_backend.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sjb.sixteen_journey_backend.entity.vo.UserBaseMsgVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 约伴表
 * </p>
 *
 * @author jcz
 * @since 2024-08-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("come_friend")
public class ComeFriend implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 私聊表id
     */
    @TableId(value = "come_friend_id", type = IdType.AUTO)
    private Integer comeFriendId;

    /**
     * 用户id
     */
    @TableField("user_id")
    @JsonIgnore
    private Integer userId;

    @TableField(exist = false)
    private UserBaseMsgVo user;

    @TableField(exist = false)
    private Boolean is_followedByUser;


    /**
     * 出发时间
     */
    @TableField("start_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private LocalDate startTime;

    /**
     * 返回时间
     */
    @TableField("end_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private LocalDate endTime;

    /**
     * 目的地
     */
    @TableField("destination")
    private String destination;

    /**
     * 出发地
     */
    @TableField("place_of_departure")
    private String placeOfDeparture;

    /**
     * 约伴说明
     */
    @TableField("description")
    private String description;

    /**
     * 创建时间
     */
    @TableField(value = "postdate",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime postdate;

    /**
     * 被收藏数量
     */
    @TableField("collected")
    private Integer collected;

    /**
     * 约伴类型 7
     */
    @TableField("status")
    private Integer status;

    /**
     * 被评论的数量
     */
    @TableField(exist = false)
    private Long commentCount;

    /**
     * 共性id
     */
    @TableField(exist = false)
    private Commonness commonness;

}
